package day20171005;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
        Scanner n = new Scanner(System.in);
        for (int m = 0; m <= 10; m++) {
            System.out.println("请输入一个数");
            int num = n.nextInt();

            String str = num + "";//将整型转化为字符型
            int i = str.length();//用length()测字符的长度
            System.out.println("该数是" + str.length() + "位数");

            for (int j = 0; j <= str.length() / 2 - 1; j++) {//循环比较数字
                if (str.charAt(j) == str.charAt(str.length() - j - 1)) {
                    System.out.println("是回文数");
                    break;
                } else System.out.println("不是回文数");
                break;
            }
        }
    }
}
